home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 141 / cdrom141.iso / aplic / ageletr / setup.exe / {code_GetDataFolder} / Templates / defaultContacts.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2007-02-25  |  3.2 KB  |  112 lines

  1. ∩╗┐<?xml version="1.0" encoding="UTF-8"?>
  2. <!--For rendering a list of contacts to HTML
  3. -->
  4. <xsl:stylesheet version="1.0"
  5. xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  6. <xsl:output method="xml" omit-xml-declaration="yes" encoding="UTF-8" />
  7.  
  8.   <xsl:template match="/">
  9.     <html>
  10. <head>
  11. <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  12. </head>
  13.  
  14.       <body style="font-size: 10pt">
  15.         <xsl:for-each select="OpenContacts/Contacts/Contact">
  16.  
  17.           <table border="0" width="100%" id="table2">
  18.             <tr>
  19.               <td width="80%">
  20.                 <font face="Times New Roman" size="3">
  21.                   <b>
  22.                     <xsl:value-of select="@Name"/>
  23.                   </b>
  24.                 </font>
  25.               </td>
  26.               <td>
  27.                 <xsl:value-of select="@Title"/>
  28.               </td>
  29.             </tr>
  30.           </table>
  31.           <div style="margin-left: 15px;">
  32.  
  33.                 <xsl:apply-templates select="Notes"/>
  34.  
  35.  
  36.           </div>
  37.           <xsl:for-each select="Sections/Section">
  38.             <div style="margin-left: 15px;">
  39.  
  40.  
  41.               <b>
  42.                 <font face="Times New Roman" size="2">
  43.                   <xsl:value-of select="@Name"/>
  44.                 </font>
  45.               </b>
  46.             </div>
  47.  
  48.  
  49.  
  50.             <table border="0" width="100%" id="table1" cellspacing="0" cellpadding="0">
  51.               <xsl:for-each select="Fields/Field">
  52.                 <tr>
  53.                   <td width="15"></td>
  54.                   <td width="80" bgcolor="#C3D9FF">
  55.                     <font face="Times New Roman" size="2">
  56.                       <xsl:value-of select="@Name"/>:
  57.                     </font>
  58.                   </td>
  59.                   <td bgcolor="#E0ECFF">
  60.                     <font size="3">
  61.                       <xsl:value-of select="@Value"/>
  62.                     </font>
  63.                   </td>
  64.                 </tr>
  65.               </xsl:for-each>
  66.  
  67.             </table>
  68.  
  69.             <div style="margin-left: 15px;">
  70.  
  71.                 <xsl:apply-templates select="Notes"/>
  72.  
  73.  
  74.             </div>
  75.  
  76.           </xsl:for-each>
  77.  
  78.           <p>  </p>
  79.         </xsl:for-each>
  80.       </body>
  81.     </html>
  82.   </xsl:template>
  83.  
  84.   <xsl:template match="Notes">
  85.       <xsl:call-template name="substitute">
  86.          <xsl:with-param name="string" select="." />
  87.       </xsl:call-template>
  88. </xsl:template>
  89.  
  90.  <xsl:template name="substitute">
  91.    <xsl:param name="string" />
  92.    <xsl:param name="from" select="' '" />
  93.    <xsl:param name="to">
  94.       <p/>
  95.    </xsl:param>
  96.    <xsl:choose>
  97.       <xsl:when test="contains($string, $from)">
  98.          <xsl:value-of select="substring-before($string, $from)" />
  99.          <xsl:copy-of select="$to" />
  100.          <xsl:call-template name="substitute">
  101.             <xsl:with-param name="string"
  102.                             select="substring-after($string, $from)" />
  103.             <xsl:with-param name="from" select="$from" />
  104.             <xsl:with-param name="to" select="$to" />
  105.          </xsl:call-template>
  106.       </xsl:when>
  107.       <xsl:otherwise>
  108.          <xsl:value-of select="$string" />
  109.       </xsl:otherwise>
  110.    </xsl:choose>
  111. </xsl:template>                
  112. </xsl:stylesheet>